export default {
    getShader: function () {
        return `
    precision mediump float;
    uniform sampler2D u_Sampler;
    uniform vec3 u_EyeDir;
    varying vec4 v_Center;
    varying vec4 v_Posi;
    varying vec3 v_Normal;
    void main(){
        vec3 fragPos = (v_Posi.xyz / v_Posi.w) / 2.0 + 0.5;
        vec2 c = (v_Center.xyz / v_Center.w).xy / 2.0 + 0.5;

        float b = 0.05;
        fragPos.x = (fragPos.x - c.x) * b + fragPos.x;
        fragPos.y = (c.y - fragPos.y) * b + fragPos.y;
        vec4 color = texture2D(u_Sampler, fragPos.xy);

        float _RimAmount = 0.1;
        float NdotV = 1.0 - dot(v_Normal, u_EyeDir);
        float rimSmooth = max(0.0, NdotV) * smoothstep(_RimAmount - 0.01, _RimAmount + 0.01, NdotV);
        vec3 lr = rimSmooth * vec3(0.0, 0.5, 1.0);
        vec3 color1 = lr + vec3(color).rgb;

        gl_FragColor = vec4(color1, color.a);
        //gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
    }
        `;
    }
}
